package com.shensi.api.admin.client.system;

import com.shensi.api.admin.client.fallback.system.SysPostClientFallBack;
import com.shensi.api.admin.domian.system.SysPost;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.page.TableDataInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author: budian
 * @since: 2023/11/30
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = SysPostClientFallBack.class)
@Component
public interface SysPostClient {
    /**
     * 获取岗位列表
     */
    @GetMapping("/list")
    public TableDataInfo list(@SpringQueryMap SysPost post);

    @GetMapping("/export")
    public AjaxResult export(@SpringQueryMap SysPost post);

    /**
     * 根据岗位编号获取详细信息
     */
    @GetMapping(value = "/{postId}")
    public AjaxResult getInfo(@PathVariable("postId") Long postId);

    /**
     * 新增岗位
     */
    @PostMapping
    public AjaxResult add(@RequestBody SysPost post);

    /**
     * 修改岗位
     */
    @PutMapping
    public AjaxResult edit(@RequestBody SysPost post);

    /**
     * 删除岗位
     */
    @DeleteMapping("/{postIds}")
    public AjaxResult remove(@PathVariable("postIds") Long[] postIds);

    /**
     * 获取岗位选择框列表
     */
    @GetMapping("/optionselect")
    public AjaxResult optionselect();
}
